package com.express.dao;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import pojo.Express;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

public interface ExpressMapper extends Mapper<Express> {

    @Delete("delete * from express where check_code = #{checkCode}")
    void deleteByCheckCode(Integer checkCode);

    @Select("select check_code from express where id = #{id}")
    Integer findCheckCodeById(Integer id);

    @Select("SELECT state_code FROM express WHERE check_code = #{checkCode}")
    Integer findStateByCheckCode(Integer checkCode);

    @Select("SELECT COUNT(*) FROM express WHERE state_code=1;")
    Integer getSUM();
}
